<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ko">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>콘텐츠관리</title>
	<script src="../js/validator.js" type="text/javascript"></script>
	<script type="text/javascript">
    function reg(frm)
    {
    	if (!write_auth)
    	{
    		alert("수정권한이 없습니다.");
    		return false;
    	}

    	if (!isTextValidate(frm.content_title, "string", 0, "제목"))			return false;
		if (!isTextValidate(frm.content_body, "string", 0, "내용"))			return false;

		return true;
    }
	</script>
</head>

<body>
		<!-- 본문 영역 -->
		<div id="contents">
			<!-- 제목 및 Location 영역 -->
			<div id="location">
				<h3 id="contentTitle"></h3>
				<div id="locationPath"></div>
			</div>
			<script type="text/javascript">
			// 현재 메뉴 경로를 설정한다.
			var pagePath = licationPth.split("_");
			var pathStr = "홈";
			for( var i=0; i < pagePath.length; i++ )
			{
				if (i+1 >= pagePath.length)
					pathStr += " &gt; <strong>" + pagePath[i] + "</strong>";
				else
					pathStr += " &gt; " + pagePath[i]
			}
			document.getElementById("contentTitle").innerHTML = pagePath[ pagePath.length - 1 ];
			document.getElementById("locationPath").innerHTML = pathStr;
			</script>

			<!-- 본문 내용 -->
			<div id="content">
				<div id="viewContent" class="">
					<div class="ar">
						<span class="button btnProc01"><input type="button" value="수정" onclick="contentEdit(); return false;" /></span>
					</div>
					<strong>${listMap.CONTENT_TITLE}</strong>
					<div>${listMap.CONTENT_BODY}</div>
				</div>

				<div id="editContent" class="hide">
					<form name="writeFrm" method="post" action="../admin/contentmng_proc.do" onsubmit="return reg(this);">
					<input type="hidden" name="mode" value="cedit" />
					<input type="hidden" name="content_sid" value="${listMap.CONTENT_SID}" />
					<div class="ar">
						<span class="button btnProc01"><input type="submit" value="저장" /></span>
						<span class="button btnProc01"><a href="#" onclick="contentRestore(); return false;">취소</a></span>
					</div>
					<table cellspacing="0" cellpadding="0" border="0" class="tbl_type04">
						<colgroup>
							<col width="150px" />
							<col />
						</colgroup>
						<tbody>
							<tr>
								<th>제목</th>
								<td><input type="text" name="content_title" size="50" maxlength="50" value="${listMap.CONTENT_TITLE}" /></td>
							</tr>
							<tr>
								<th>내용</th>
								<td><textarea name="content_body" cols="95" rows="30">${listMap.CONTENT_BODY}</textarea></td>
							</tr>
						</tbody>
					</table>
					</form>
				</div>

			</div>
		</div>
</body>
</html>
